<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <h:body>

        <ui:composition template="../communityTemplate.xhtml">
            <ui:define name="left">
                <ul>
                    <li><a href="interest.jsf">My Interests</a></li>
                    <li><a href="../Status/wall.jsf">My Wall</a></li>
                </ul>
            </ui:define>

            <ui:define name="content">
                <p:panel header="Friend Updates" toggleable="true">
                    <h:form>
                        <p:dataTable id="dStatus" var="update" value="#{profileBean.updates}"
                                     paginator="true" rows="20"  
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                     rowsPerPageTemplate="20,50,100">

                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Update"/>
                                </f:facet>
                                <h:outputText value="#{update.update}"/>
                            </p:column>

                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Name"/>
                                </f:facet>
                                <h:outputText value="#{update.updater}"/>
                            </p:column>

                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Time updated"/>
                                </f:facet>
                                <h:outputText value="#{update.modifiedDate}"/>
                            </p:column>

                        </p:dataTable>
                    </h:form>
                </p:panel>
                <p:panel header="Friendlist" toggleable="true">
                    <h:form>
                        <p:dataTable id="friends" var="friend" value="#{profileBean.friends}">
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Name"/>
                                </f:facet>
                                <h:outputText value="#{friend.name}"/>
                            </p:column>
                            
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Options"/>
                                </f:facet>
                                
                                <h:commandButton value="remove friend" actionListener="#{profileBean.removeFriendListener}">
                                    <f:attribute name="selection" value="#{friend}"/>
                                </h:commandButton>
                                
                                
                            </p:column>
                        </p:dataTable> 
                    </h:form>
                </p:panel>
            </ui:define>
        </ui:composition>

    </h:body>

</html>

